import request from '../../utils/request'

// 获取题目列表
export const getQuestionList = () => request.get('/questionList')

export interface IQuestion {
  id?: number,
  questionType?: number,
  subjectId?: any,
  createUser?: number,
  score?: number,
  status?: number,
  correct?: string,
  difficult?: number,
  shortTitle?: string
  item?:any
}

// 添加题目列表
export const addQuestionList = (data: IQuestion) => request.post('/questionList', data)

// 编辑题目列表 
export const editQuestionList = (id: any, data: IQuestion) => request.put(`/questionList/${id}`, data)

// 删除题目列表
export const delQuestionList = (id: number) => request.delete(`questionList/${id}`)

//查询题目
export const findQuestionList = (shortTitle: any) => request.get('/questionList', {params: shortTitle})